package simple;

/**
 * 生产车的工厂，负责创建实例
 */
public class CarFactory {

    public static Car getCar(String carName) {
        if (carName.equals("Wulin")) {
            return new WulinCar();

        } else if (carName.equals("Audi")) {
            return new AudiCar();
        } else {
            return null;
        }
    }
}
